# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=tree-sitter-just
pkgver=0_git20230318
_gitrev=4e5f5f3ff37b12a1bbf664eb3966b3019e924594
pkgrel=0
pkgdesc="Treesitter grammar for Justfiles (casey/just)"
url="https://github.com/IndianBoy42/tree-sitter-just"
arch="all"
license="Apache-2.0"
makedepends="tree-sitter-dev"
checkdepends="tree-sitter-cli"
install_if="tree-sitter-grammars"
source="$pkgname-$_gitrev.tar.gz::https://github.com/IndianBoy42/tree-sitter-just/archive/$_gitrev.tar.gz"
builddir="$srcdir/$pkgname-$_gitrev"

prepare() {
	default_prepare

	mv "$builddir"/queries/just/* -t "$builddir"/queries
}

build() {
	abuild-tree-sitter build
}

check() {
	tree-sitter test
}

package() {
	DESTDIR="$pkgdir" abuild-tree-sitter install
}

sha512sums="
ed40d42d6ca9d56d5ad6f55cd25534e482dae539a86f30149bb472d93b13ca9827f36bc6ab40d1e1f90a1e38f51ae3b354f547c11f17a9ddceb4d9391f233fb0  tree-sitter-just-4e5f5f3ff37b12a1bbf664eb3966b3019e924594.tar.gz
"
